home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 August / August CD.bin / Shareware / Education / numericalmethods Folder / chap_4 / zasin.m < prev    next >
Encoding:
Text File  |  1994-06-05  |  899 b   |  54 lines  |  [MATF/MATL]

  1. function [fun,dfun,ifun,x0,m,C,Ax] = zasin
  2. % Taylor series coefficient lists for several functions.
  3. % Pm(x) = c(1) + c(2)x + c(2)x^2 + ... + c(m+1)x^m
  4. % fun  is the function, output.
  5. % dfun is the derivative, output.
  6. % ifun is the integral, output.
  7. % x0 is the point of expansion, output.
  8. % m  is the degree of the polynomial, output.
  9. % C  is the coefficient list, output.
  10. % Ax contains three asis vectors plotting, output.
  11. x0 = 0; 
  12. m = 25;
  13. a = -0.999999;
  14. b = 0.999999;
  15. ymin = -pi/2;
  16. ymax = pi/2;
  17. ymin1 = 0;
  18. ymax1 = 5;
  19. ymin2 = 0;
  20. ymax2 = 1;
  21. Ax(1,:) = [a b ymin ymax];
  22. Ax(2,:) = [a b ymin1 ymax1];
  23. Ax(3,:) = [a b ymin2 ymax2];
  24. fun = 'asin(x)';
  25. dfun = 'sqrt(1 - x.^2).^(-1)';
  26. ifun = '-1+sqrt(1 - x.^2) + x.*asin(x)';
  27. C = [676039/104857600,
  28. 0,
  29. 88179/12058624,
  30. 0,
  31. 46189/5505024,
  32. 0,
  33. 12155/1245184,
  34. 0,
  35. 6435/557056,
  36. 0,
  37. 143/10240,
  38. 0,
  39. 231/13312,
  40. 0,
  41. 63/2816,
  42. 0,
  43. 35/1152,
  44. 0,
  45. 5/112,
  46. 0,
  47. 3/40,
  48. 0,
  49. 1/6,
  50. 0,
  51. 1,
  52. 0];
  53.  
  54.